import { WriteAPI } from '@/http/index'

export const DelAccount=async(id: number)=>{
    return WriteAPI({
        url:'/api/Account/DelAccount',
        method:'delete',
        params:{ id: id }
    })
}

export const DelMeet=async(id: number)=>{
    return WriteAPI({
        url:'/api/Meet/DelMeet',
        method:'delete',
        params:{ id: id }
    })
}

export const UpdateAccount=async(data:any)=>{
    return WriteAPI({
        url:'/api/Account/UpdateAccount',
        method:'post',
        data
    })
}

export const UpPhoto=async(data:any)=>{
    return WriteAPI({
        url:'/api/Meet/UpPhoto',
        method:'post',
        data
    })
}

export const AddMeet=async(data:any)=>{
    return WriteAPI({
        url:'/api/Meet/AddMeet',
        method:'post',
        data
    })
}

export const UpdateMeet=async(data:any)=>{
    return WriteAPI({
        url:'/api/Meet/UpdateMeet',
        method:'post',
        data
    })
}

export const DelAppointment=async(id:number)=>{
    return WriteAPI({
        url:'/api/Appointments/DelAppointments',
        method:'delete',
        params:{ id: id }
    })
}

export const AddAppointment=async(data:any)=>{
    return WriteAPI({
        url:'/api/Appointments/AddAppointments',
        method:'post',
        data
    })
}

//更新会议预约
export const UpdateAppointment=async(data:any)=>{
    return WriteAPI({
        url:'/api/Appointments/UpdateAppointments',
        method:'post',
        data
    })
}

//新增部门
export const AddDepartment=async(data:any)=>{
    return WriteAPI({
        url:'/api/Department/AddDepartment',
        method:'post',
        data
    })
}

//更新部门状态
export const UpdateStatusDepartment=async(data:any)=>{
    return WriteAPI({
        url:'/api/Department/UpdateStatusDepartment',
        method:'post',
        params:{
            departmentid:data
        }
    })
}

//删除部门
export const DelDepartment=async(id:number)=>{
    return WriteAPI({
        url:'/api/Department/DelDepartment',
        method:'delete',
        params:{ departmentid: id }
    })
}

//部门修改
export const UpdateDepartment=async(data:any)=>{
    return WriteAPI({
        url:'/api/Department/UpdateDepartment',
        method:'post',
        data
    })
}

//角色删除
export const DeleteRole=async(id:number)=>{
    return WriteAPI({
        url:'/api/RoleManager/GetRoleIdToDel',
        method:'delete',
        params:{ id: id }
    })
}

//修改角色状态
export const UpdateStatusRole=async(data:any)=>{
    return WriteAPI({
        url:'/api/RoleManager/UpdateRoleStatus',
        method:'get',
        params:data
    })
}

//新增角色
export const AddRole=async(data:any)=>{
    return WriteAPI({
        url:'/api/RoleManager/AddRole',
        method:'post',
        data
    })
}

//给角色添加人员
export const AddRoleToAccount=async(data:any)=>{
    return WriteAPI({
        url:'/api/RoleManager/GetRoleToAddAccount',
        method:'post',
        data
    })
}

//修改角色
export const UpdateRole=async(data:any)=>{
    return WriteAPI({
        url:'/api/RoleManager/GetRoleIdToUpdate',
        method:'get',
        params:data
    })
}

//获取角色id更改应有的权限
export const GetRoleIdToUpdatePermissions=async(data:any)=>{
    return WriteAPI({
        url:'/api/Permissions/GetRoleIdToUpdatePermissions',
        method:'get',
        params:data
    })
}

//会议审批处理
export const ApproveMeetProcess=async(data:any)=>{
    return WriteAPI({
        url:'/api/Appointments/ProcessMeet',
        method:'get',
        params:data
    })
}
//会议审批处理

//获取会议预约Id进行审批的重新提交
export const GetAppointmentsIdToProcess=async(data:any)=>{
    return WriteAPI({
        url:'/api/Appointments/ProcessRefuse',
        method:'get',
        params:data
    })
}